import {
  request
} from '../helpers.js';

let debug = process.env.NODE_ENV != 'product';

/*
 * @return {total, list}
 */
export const getTableData = function(params) {
  return request({
    url: '/admin',
    params: params
  });
}

export const getInfo = function(id) {
  return request({
    url: '/admin/'+ id
  })
}

// 新增管理员
export const store = function(data) {
  return request({
    url: '/admin',
    method: 'post',
    data: data
  });
}

// 编辑管理员
export const update = function(data,id) {
  return request({
    url: '/admin/' + id,
    method: 'put',
    data: data
  })
}

// 删除管理员
export const del = function(id) {
  return request({
    url: '/admin/' + id,
    method: 'delete'
  })
}
